package com.xuecheng.api;

import com.xuecheng.content.service.CourseCategoryService;
import com.xuecheng.module.dto.CourseCategoryDto;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 星河一叶Ck
 * @date 2025/4/17
 */

@RestController
@RequiredArgsConstructor
public class CourseCategoryController {

    private final CourseCategoryService courseCategoryService;

    /**
     * 获取课程分类 返回的是一个数组 多个分类 每个分类又是树形多级
     * @return
     */
    @GetMapping("/course-category/tree-nodes")
    public List<CourseCategoryDto> queryTreeNodes () {
        return courseCategoryService.queryTreeNodes("1");
    }
}
